/**
 * 商品相关类型定义
 */

// 商品状态枚举
export enum GoodsStatus {
  AVAILABLE = "available", // 可售
  SOLD = "sold", // 已售出
  RESERVED = "reserved", // 已预定
  OFFLINE = "offline", // 已下架
}

// 商品分类
export interface GoodsCategory {
  id: string;
  name: string;
  icon: string;
  sort: number;
}

// 商品信息
export interface GoodsItem {
  id: string;
  title: string;
  description: string;
  price: number;
  originalPrice?: number;
  images: string[];
  category: string;
  categoryName: string;
  status: GoodsStatus;
  sellerId: string;
  sellerName: string;
  sellerAvatar: string;
  location: string;
  viewCount: number;
  favoriteCount: number;
  isFavorite: boolean;
  publishTime: string;
  updateTime: string;
  tags?: string[];
}

// 商品列表查询参数
export interface GoodsListParams {
  page?: number;
  pageSize?: number;
  categoryId?: string;
  keyword?: string;
  minPrice?: number;
  maxPrice?: number;
  status?: GoodsStatus;
  sortBy?: "publishTime" | "price" | "viewCount";
  sortOrder?: "asc" | "desc";
}
